package logger

import (
	"log"
	"os"
	"path/filepath"
)

// InitLog Unable to output from the console after configuration
func InitLog() {
	rootPath, _ := os.Getwd()
	logFile, _ := os.OpenFile(filepath.Join(rootPath, "gofw-cache.log"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
	log.SetOutput(logFile)
	log.SetPrefix("[gofw-cache]")
	log.SetFlags(log.Lshortfile | log.Lmicroseconds | log.Ldate)
}
